﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EBAYVN.DOMAIN;
namespace EBAYVN.DAO
{
    public class LoaiSanPhamDao
    {
        private EBAYVNDOMAINDataContext _db;
        public LoaiSanPhamDao()
        {
            _db = new EBAYVNDOMAINDataContext();
        }
        public List<LOAISANPHAM> GetList()
        {
            return _db.LOAISANPHAMs.Where(p => p.ISSHOW.HasValue && p.ISSHOW.Value).OrderBy(p => p.TENLOAISP).ToList();
        }
        public LOAISANPHAM Get(String id)
        {
            return _db.LOAISANPHAMs.Where(p => p.MALOAISP.Equals(id)).SingleOrDefault();
        }
        
    }
}
